package cdms.domain;

import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * Deliveryorder entity class
 * 
 * @author chenjing
 * @version 1.0
 *
 */
public class DeliveryOrder {

	private Long id;

	private String orderId;

	private Manager manager;

	private Sender sender;

	@NotNull
	@Size(min = 3, max = 30)
	private String receiveAddress;

	@NotNull
	@Size(min = 11, max = 11)
	private String receivePhone;

	@NotNull
	@Size(min = 3, max = 30)
	private String deliverAddress;

	@NotNull
	@Size(min = 11, max = 11)
	private String deliverPhone;

	@NotNull
	private Double cost;

	private Date releaseTime;

	private Date receiveTime;

	private Date finishTime;

	private int state;

	public DeliveryOrder() {

	}

	/**
	 * @param id             primary key
	 * @param orderId
	 * @param manager
	 * @param receiveAddress
	 * @param deliverAddress
	 * @param cost
	 * @param releaseTime
	 */
	public DeliveryOrder(Long id, String orderId, Manager manager, String receiveAddress, String receivePhone,
			String deliverAddress, String deliverPhone, double cost, Date releaseTime) {
		this(id, orderId, manager, null, receiveAddress, receivePhone, deliverAddress, deliverPhone, cost, releaseTime,
				null, null, 0);
	}

	/**
	 * @param id             primary key
	 * @param orderId
	 * @param manager
	 * @param sender
	 * @param receiveAddress
	 * @param receivePhone
	 * @param deliverAddress
	 * @param deliverPhone
	 * @param cost
	 * @param releaseTime
	 * @param receiveTime
	 * @param finishTime
	 * @param state
	 */
	public DeliveryOrder(Long id, String orderId, Manager manager, Sender sender, String receiveAddress,
			String receivePhone, String deliverAddress, String deliverPhone, double cost, Date releaseTime,
			Date receiveTime, Date finishTime, int state) {
		super();
		this.id = id;
		this.orderId = orderId;
		this.manager = manager;
		this.sender = sender;
		this.receiveAddress = receiveAddress;
		this.receivePhone = receivePhone;
		this.deliverAddress = deliverAddress;
		this.deliverPhone = deliverPhone;
		this.cost = cost;
		this.releaseTime = releaseTime;
		this.receiveTime = receiveTime;
		this.finishTime = finishTime;
		this.state = state;
	}

	/**
	 * @return the sender
	 */
	public Sender getSender() {
		return sender;
	}

	/**
	 * @param sender the sender to set
	 */
	public void setSender(Sender sender) {
		this.sender = sender;
	}

	/**
	 * @return the receiveTime
	 */
	public Date getReceiveTime() {
		return receiveTime;
	}

	/**
	 * @param receiveTime the receiveTime to set
	 */
	public void setReceiveTime(Date receiveTime) {
		this.receiveTime = receiveTime;
	}

	/**
	 * @return the finishTime
	 */
	public Date getFinishTime() {
		return finishTime;
	}

	/**
	 * @param finishTime the finishTime to set
	 */
	public void setFinishTime(Date finishTime) {
		this.finishTime = finishTime;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @return the orderId
	 */
	public String getOrderId() {
		return orderId;
	}

	/**
	 * @return the manager
	 */
	public Manager getManager() {
		return manager;
	}

	/**
	 * @return the receiveAddress
	 */
	public String getReceiveAddress() {
		return receiveAddress;
	}

	/**
	 * @return the deliverAddress
	 */
	public String getDeliverAddress() {
		return deliverAddress;
	}

	/**
	 * @return the cost
	 */
	public Double getCost() {
		return cost;
	}

	/**
	 * @return the releaseTime
	 */
	public Date getReleaseTime() {
		return releaseTime;
	}

	/**
	 * @return the state
	 */
	public int getState() {
		return state;
	}

	/**
	 * @param state the state to set
	 */
	public void setState(int state) {
		this.state = state;
	}

	/**
	 * @return the receivePhone
	 */
	public String getReceivePhone() {
		return receivePhone;
	}

	/**
	 * @return the deliverPhone
	 */
	public String getDeliverPhone() {
		return deliverPhone;
	}

	/**
	 * @param orderId the orderId to set
	 */
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	/**
	 * @param manager the manager to set
	 */
	public void setManager(Manager manager) {
		this.manager = manager;
	}

	/**
	 * @param receiveAddress the receiveAddress to set
	 */
	public void setReceiveAddress(String receiveAddress) {
		this.receiveAddress = receiveAddress;
	}

	/**
	 * @param receivePhone the receivePhone to set
	 */
	public void setReceivePhone(String receivePhone) {
		this.receivePhone = receivePhone;
	}

	/**
	 * @param deliverAddress the deliverAddress to set
	 */
	public void setDeliverAddress(String deliverAddress) {
		this.deliverAddress = deliverAddress;
	}

	/**
	 * @param deliverPhone the deliverPhone to set
	 */
	public void setDeliverPhone(String deliverPhone) {
		this.deliverPhone = deliverPhone;
	}

	/**
	 * @param cost the cost to set
	 */
	public void setCost(Double cost) {
		this.cost = cost;
	}

	/**
	 * @param releaseTime the releaseTime to set
	 */
	public void setReleaseTime(Date releaseTime) {
		this.releaseTime = releaseTime;
	}

}
